# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=verilator
pkgver=5.024
pkgrel=0
pkgdesc="Convert Verilog and SystemVerilog to C++ or SystemC"
url="https://verilator.org"
arch="x86 x86_64" # limited by systemc
license="LGPL-3.0-only"
depends="perl"
makedepends="autoconf automake python3 systemc-dev flex flex-dev bison lsb-release help2man"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/verilator/verilator/archive/refs/tags/v$pkgver/verilator-$pkgver.tar.gz"

prepare() {
	default_prepare
	autoconf
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
34184f4c08bcbecf563b424c4c0fdcaf0c04d60e19887c4df5161b48db256dd7cbe960c71f854bd3dad073c193bbc0c576f171f84b634da58259b81e1afaf622  verilator-5.024.tar.gz
"
